/*
package Execute;

public class ExecuteReadAndConver {

}
 */
package Execute;

import java.io.File;

import Convertisseur.Convertisseur;
import Convertisseur.ReceptionCritere;
import Convertisseur.TimeDateDay;
import Convertisseur.VariableFlags;
import DataStorage.InformationLigneDAOHibernate;
import DataStorage.RepertoireDAOHibernate;
import FileSystemView.ReadFileToExcel;
import HibernateSQLite.java.model.Repertoire;

//public class ExecuteConvertisseur extends VariableFlags {
public class ExecuteReadAndConver {

	public static void main(String[] args) {
		/*
		@SuppressWarnings("unused")
		InformationLigneDAOHibernate informationLigneDAO = new  InformationLigneDAOHibernate();
		//long InformationLigne_id = informationLigneDAO.getInformationLigne_ID(VariableFlags.getOrgane(), VariableFlags.getDiversite(),
			//	VariableFlags.getSite(), VariableFlags.getN_ligne(),VariableFlags.getAnnee());

		long InformationLigne_id = 2;
		RepertoireDAOHibernate repertoireDAO = new RepertoireDAOHibernate();
		Repertoire repertoire = repertoireDAO
				.getRepertoire(InformationLigne_id);
		ReceptionCritere receptionCritere =new  ReceptionCritere();
		receptionCritere.Execute(repertoire.getCritere_path());
		*/
		
		
		File file1 = new File(
				"Macro file Original\\X61\\X61_Essieu-579656 ch323212-2012-J132.txt");
		// "Macro file Original\\X91_Essieu 2RD-299862 ch 1102120-2012-J073.txt");
		// "I:/_DataAppMetier/newtec/LEM/FRLEM007/mesures/X95/Types 1,2,A,B,C/2012/J156/X95_Types 1,2,A,B,C-1.1.150 400120 ch330 stat-2012-J156.txt");
		File file2 = new File(
				"Macro file Original\\X61\\X61_Essieu-579654 ch421212-2012-J135.txt");
		//"Macro file Original\\X91_Essieu 2RD-299 861 ch 110 1120-2012-J074.txt");
		// "I:/_DataAppMetier/newtec/LEM/FRLEM007/mesures/X95/Types 1,2,A,B,C/2012/J153/X95_Types 1,2,A,B,C-stat 1.1.150.400123 ch110-2012-J153.txt");
		File file3 = new File(
				"Macro file Original\\X61\\X61_Essieu-579653 ch213121-2012-J136.txt");
		//"Macro file Original\\X91_Essieu 2RD-300 255 ch 110 1120-2012-J076.txt");
		// "I:/_DataAppMetier/newtec/LEM/FRLEM007/mesures/X95/Types 1,2,A,B,C/2012/J152/X95_Types 1,2,A,B,C-1.1.150 400122 ch330-2012-J152.txt");
		File file4 = new File(
				"Macro file Original\\X61\\X61_Essieu-579655 ch112121-2012-J137.txt");
		//"Macro file Original\\X91_Essieu 2RD-300254 . ch 1102120-2012-J080.txt");
		// "I:/_DataAppMetier/newtec/LEM/FRLEM007/mesures/X95/Types 1,2,A,B,C/2012/J152/X95_Types 1,2,A,B,C-1.1.150.400121ch110-2012-J152.txt");

		// bras
		File file5 = new File(
				"Macro file Original\\X61\\X61_Essieu-bras A21-2012-J132.txt");
		File file6 = new File(
				"Macro file Original\\X61\\X61_Essieu-bras A22-2012-J132.txt");
		File file7 = new File(
				"Macro file Original\\X61\\X61_Essieu-bras b21-2012-J130.txt");
		File file8 = new File(
				"Macro file Original\\X61\\X61_Essieu-bras B22-2012-J132.txt");

		// EL(9 Element)
		File file9 = new File(
				"Macro file Original\\X61\\X61_Essieu-EL B21 556 149-2012-J075.txt");
		File file10 = new File(
				"Macro file Original\\X61\\X61_Essieu-EL B22 556 150-2012-J075.txt");
		File file11 = new File(
				"Macro file Original\\X61\\X61_Essieu-EL B23 556 151-2012-J075.txt");
		File file12 = new File(
				"Macro file Original\\X61\\X61_Essieu-El�ment  B23  Totale-2012-J206.txt");
		File file13 = new File(
				"Macro file Original\\X61\\X61_Essieu-El�m�nt  B22  Totale-2012-J206.txt");
		File file14 = new File(
				"Macro file Original\\X61\\X61_Essieu-El�ment et Bad  B21  Totale-2012-J206.txt");
		File file15 = new File(
				"Macro file Original\\X61\\X61_Essieu-T2 �l�ment B21  -2012-J132.txt");
		File file16 = new File(
				"Macro file Original\\X61\\X61_Essieu-T2 �l�ment B22-2012-J132.txt");
		File file17 = new File(
				"Macro file Original\\X61\\X61_Essieu-T2 �l�ment B23-2012-J132.txt");

		//File[] files_essieu = { file1, file2, file3, file4 };
		//File[] files_bras = { file5, file6, file7, file8 };
		//File[] files_EL = { file9, file10,file11,file12 ,file13, file14, file15, file16, file17};
		File[] files = { file1, file2, file3, file4,file5, file6, file7, file8 };
		// List<File> listfiles = Arrays.asList(files);
		
		
		ReadFileToExcel excel = new ReadFileToExcel();
		excel.setExcelFileName("temp/MacroFileTemp.xls");
		excel.setFiles(files);
		excel.readFileToExcel();
		
		/*
		ReadFileToExcel excel = new ReadFileToExcel();
		excel.setExcelFileName("temp/MacroFileTemp.xls");
		excel.setFiles(files_essieu);
		excel.readFileToExcel();
		
		//essieu
		excel.setExcelFileName("temp/essieu.xls");
		excel.setFiles(files_essieu);
		excel.readFileToExcel();
		System.out.println(excel.getExcelFileName());
		
		
		//bras
		excel.setExcelFileName("temp/bras.xls");
		excel.setFiles(files_bras);
		excel.readFileToExcel();
		System.out.println(excel.getExcelFileName());
		
		//EL
		excel.setExcelFileName("temp/EL.xls");
		excel.setFiles(files_EL);
		excel.readFileToExcel();
		System.out.println(excel.getExcelFileName());
*/		
		//---------------------------------------
		// init message
		VariableFlags.setSite("Le Mans");
		VariableFlags.setN_ligne("1");
		VariableFlags.setAnnee("2012");
		//VariableFlags.setOrgane("X91");//Organe
		//VariableFlags.setDiversite("Essieu 2RD");
		VariableFlags.setOrgane("X61");// Organe
		VariableFlags.setDiversite("Essieu");

		
		String fileNameDfq = VariableFlags.getOrgane() + " "
				+ VariableFlags.getDiversite() + " " + VariableFlags.getSite()
				+ "-" + VariableFlags.getN_ligne() + " dayTime"
				+ TimeDateDay.getNowTime2() + ".dfq";
		// repertoire
		VariableFlags.setFileQ_DASName(fileNameDfq);
		VariableFlags.setSynoptique_Ligne("Synoptique_Ligne:ss");
		VariableFlags.setAdresse_Image_Macrographie("\\root\\Macro\\X91-2RD\\");

		Convertisseur conver = new Convertisseur();
		System.out.println(excel.getExcelFileName());
		conver.initialization(excel.getExcelFileName());

	}
}
